<!DOCTYPE html>
<html>
	<head>
		<title>Dynamic loading with appending content</title>
		<link rel="stylesheet" href="../../../codebase/webix.css" type="text/css" charset="utf-8">
		<script src="../../../codebase/webix.js" type="text/javascript" charset="utf-8"></script>

		<link rel="stylesheet" type="text/css" href="../common/samples.css">
		<script src="../common/testdata.js" type="text/javascript" charset="utf-8"></script>
	</head>
	<body>
		<div class='header_comment'>Dynamic loading with appending content</div>
		<div class='sample_comment'>The sample shows the use of method 'loadNext()'. The method allows you to invoke loading of the specified number of records to DataTable.</div>
		<div class='sample_comment'>Dynamic loading from DB (sqllite + php).</div>
		<div id="testA" style='height:300px'></div>
		<hr>
		<input type='button' value='load next 10 records' onclick='loadNext()' class='sample_button'>
		<script type="text/javascript" charset="utf-8">
		function loadNext(){
			grida.loadNext(10,null,function(a,b,c,d){
				this.showItemByIndex(this.count()-10);
			});
		}

		webix.ready(function(){
			grida = new webix.ui({
				container:"testA",
				view:"datatable",
				columns:[
					{ id:"package",	header:"Name", 			width:200 },
					{ id:"section",	header:"Section",		width:120 },
					{ id:"size",	header:"Size" , 		width:80  },
					{ id:"architecture",	header:"PC", 		width:60  }
				],
				
				autowidth:true
			});	
			grida.loadNext(10,0,null,"data/data.php");
		});
		</script>
	</body>
</html>